<?php
/**
 * @name IndexController
 * @author root
 * @desc 默认控制器
 * @see http://www.php.net/manual/en/class.yaf-controller-abstract.php
 */
class IndexController extends Yaf_Controller_Abstract {

	public function init()
	{
		$this->Session         = Yaf_Registry::get("session");
		$this->ReportModel     = new ReportModel();
		$this->CollectionModel = new CollectionModel();		
		$user = $this->Session->user_info;
           if(empty($user)){
			$this->redirect('/User/login');
			return true;
		}
		
	}


	public function indexAction() {
        date_default_timezone_set('PRC');
        $arr     = array();
    	$nowDate = time();
    	for($i = 0; $i<7; $i++){
    		$getTime = $nowDate-3600*24*$i;
			$arr[$i] = date("Y-m-d ",$getTime);
    	}
    	// $pushArticle_info      = $this->ReportModel->selectPushInfoByTime($arr);

    	// $collArticle_info      = $this->CollectionModel->selectCollInfoByTime($arr);

    	// $collErrorArticle_info = $this->CollectionModel->selectCollErrorInfoByTime($arr);

    	// $pushErrorArticle_info = $this->ReportModel->selectPushErrorInfoByTime($arr);
     //    $this->getView()->assign("collErrorArticle_info",$pushErrorArticle_info);
    	// $this->getView()->assign("pushErrorArticle_info",$pushErrorArticle_info);

     //    $this->getView()->assign("pushArticle_info",$pushArticle_info);

     //    $this->getView()->assign("collArticle_info",$collArticle_info);
        //var_dump($collArticle_info);
	}
}
